Skip to content

Remove gotestfmt#1069

Merged
t0yv0 merged 4 commits into
masterfrom
t0yv0/remove-gotestfmt
Sep 5, 2024
Merged

Remove gotestfmt#1069
t0yv0 merged 4 commits into
masterfrom
t0yv0/remove-gotestfmt

Conversation

@t0yv0

@t0yv0 t0yv0 commented Sep 5, 2024

Copy link
Copy Markdown
Contributor

Engineers noticing gotestfmt reporting test output in a confusing way, such as mis-attributing logs from one test to another or not reporting logs if a panic is encountered. This change removes this utility, switching to default Go test output. It also removes the -v flag so that the test failure output is minimally scoped to the failing tests and is easier to find. Defaults for the win.

@t0yv0 t0yv0 requested review from a team and blampe September 5, 2024 21:21

@guineveresaenger guineveresaenger left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's see what this looks like!

@t0yv0 t0yv0 added this pull request to the merge queue Sep 5, 2024
Merged via the queue into master with commit c98af28 Sep 5, 2024
@t0yv0 t0yv0 deleted the t0yv0/remove-gotestfmt branch September 5, 2024 23:02
@thomas11

thomas11 commented Sep 6, 2024

Copy link
Copy Markdown
Contributor

@t0yv0, @guineveresaenger Late to the party but we've had the same issues in azure-native and I had good initial results with tparse instead. Here's a draft PR; you can look at the test results. It's essentially just regular go test output but with a summary at the end.

t0yv0 added a commit that referenced this pull request Sep 6, 2024
@t0yv0 t0yv0 mentioned this pull request Sep 6, 2024
github-merge-queue Bot pushed a commit that referenced this pull request Sep 6, 2024
Reverts #1069

I'll redo it without removing GoTestFmt install step to fix:

#1070
github-merge-queue Bot pushed a commit that referenced this pull request Sep 9, 2024
Take 2 on removing gotestfmt. Since extension workflows still use it,
retain the installation stanza, but not actually use in tests.

pulumi/pulumi-azure-native#3404 is promising but
to be evaluated later I think?

Previously: #1069
#1071
thomas11 added a commit to pulumi/pulumi-azure-native that referenced this pull request Sep 27, 2024
Following ci-mgmt where it [was already
removed](pulumi/ci-mgmt#1069).
github-merge-queue Bot pushed a commit that referenced this pull request Mar 12, 2026
Fixes #2106.

## Context

We previously used
[`gotestfmt`](#1069) to improve
test output readability on CI, but it was
[removed](#1072) because it was
mis-attributing logs from one test to another and not reporting logs
when a panic was encountered — making failures harder to diagnose rather
than easier.

`gotestsum` is a more robust alternative. This PR introduces two
Makefile variables:
- `GO_TEST_EXEC ?= go test` — set to `"gotestsum --format github-actions
--"` on CI via the workflow `env:` block
- `TESTTAGS ?= all` — overridden per-language in the non-shorted matrix
path

## Why the workflow had to change too

An earlier attempt set `GO_TEST_EXEC` in the workflow env and relied on
Make's `?=` to pick it up. This worked for the **sharded path** (which
calls `make test`), but not the **non-sharded path**, which called `go
test` directly in the workflow YAML — bypassing the Makefile entirely.
awsx uses the non-sharded path, so `GO_TEST_EXEC` was never consulted.

This change moves all test invocations through `make` so `GO_TEST_EXEC`
is always honoured, and also aligns with the strategic goal of keeping
workflows "dumb" — test logic lives in the Makefile, not scattered
across workflow YAML.

## Changes

- Add `GO_TEST_EXEC ?= go test` and `TESTTAGS ?= all` to both `base` and
`parameterized-go` Makefile templates
- Use `$(GO_TEST_EXEC)` and `$(TESTTAGS)` in `test` and `test_provider`
make targets
- Set `GO_TEST_EXEC: "gotestsum --format github-actions --"` in the test
workflow's global `env:`
- Replace non-sharded `go test` workflow steps with `make
TESTTAGS=<language> GOTESTARGS=<flags> test`
- Add `gotestsum` via aqua to `mise.test.toml` so it is installed in
test workflow environments

## Test plan

- [x] `make test-go test-providers` passes — all 15 test providers
regenerate and pass actionlint
- [x] Verify gotestsum output on a real provider CI run — sample run:
pulumi/pulumi-awsx#1907
- Works like a charm! <img width="984" height="606" alt="image"
src="https://github.com/user-attachments/assets/79e08f6a-4ec0-4483-93f6-f32f6d77406a"
/>

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants